<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>撰写博客</title>

</head>
<body>
<form action="{% url 'blog:edit_response' %}" method="post">
    {% csrf_token %}
    {% if article %}
        <input type="hidden" name="article_id" value="{{ article.id }}">
        <label>
            文章标题：
            <input type="text" name="title" value="{{ article.title }}">
        </label>
        <br/>
        <h3>文章内容:</h3>
        <label>
            <textarea rows="10" cols="66" name="content">
                {{ article.content }}
            </textarea>
        </label>
        <br/>
    {% else %}
        <input type="hidden" name="article_id" value="0">
        <label>
            文章标题：
            <input type="text" name="title">
        </label>
        <br/>
        <h3>文章内容:</h3>
        <label>
            <textarea rows="10" cols="66" name="content">
            </textarea>
        </label>
        <br/>
    {% endif %}
        <input type="submit" value="提交">

</form>
    <a href="{% url 'blog:first' %}">返回首页</a>
</body>
</html>